//
//  QRScannerController.swift
//  SwiftDemo
//
//  Created by xxcao on 2016/12/30.
//  Copyright © 2016年 xxcao. All rights reserved.
//

import UIKit

class QRScannerController: BaseViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        view.backgroundColor = UIColor.white
        title = "Scan"
        
        let btn = UIButton()
        btn.titleForNormal = "取消"
        btn.titleColorForNormal = UIColor.darkGray
        btn.frame = CGRect.init(x: 0, y: 0, width: 40, height: 40)
        btn.addTarget(self, action: #selector(cancelThisPage(sender:)), for: UIControlEvents.touchUpInside)
        let leftBarItem = UIBarButtonItem.init(customView: btn)
        navigationItem.leftBarButtonItem = leftBarItem
    }
    
    @objc private func cancelThisPage(sender:AnyObject){
        dismiss(animated: true, completion: nil)
    }
}
